<?php

class news extends Controller{
	public function Fibonnaci($n) {
		$a = 1;
		$b = 1;
		if($n < 2 )
			return 1;
		for($i = 2; $i < $n; $i++) {
			$a += $b;
			$b = $a - $b;
		}
		return $a;
	}
	public function index() {
	
		//extract POST and GET
		$this->getList();
		extract($_POST);
		extract($_GET);
	
		$this->data['contenu']="hello world";
		
		if(!isset($_GET['action']) || isset($_POST['action'])) {
			return $this->getForm();
		}
	
	} //End function index
	
	/*
	 * @return unknow
	* */
	public function getForm() {
		$this->children = array (
				'common/header',
				'common/left',
				'common/right',
				'common/footer'
		);
		$this->template = 'news/example.html';
	
		return $this->render(true);
	}
	
	public function getList()
	{
		$this->load('model/news/news.php');
		
		$list = $this->model_news->getList();
		
		return $list;
	}
}

?>